13. RANSAC Overview
RANSAC Overview
In our tabletop scenario, combining some prior knowledge about the scene with a few point cloud filters, you were able to reduce the point cloud down to just the table and objects on top of it.
Next in your perception pipeline, you need to remove the table itself from the scene. To do this you will use a popular technique known as Random Sample Consensus or "RANSAC". RANSAC is an algorithm, that you can use to identify points in your dataset that belong to a particular model. In the case of the 3D scene you're working with here, the model you choose could be a plane, a cylinder, a box, or any other common shape.
The RANSAC algorithm assumes that all of the data in a dataset is composed of both inliers and outliers, where inliers can be defined by a particular model with a specific set of parameters, while outliers do not fit that model and hence can be discarded. Like in the example below, we can extract the outliners that are not good fits for the model.
If you have a prior knowledge of a certain shape being present in a given data set, you can use RANSAC to estimate what pieces of the point cloud set belong to that shape by assuming a particular model.
By modeling the table as a plane, you can remove it from the point cloud to obtain the following result:
On the other hand, a disadvantage of RANSAC is that there is no upper limit on the time it can take to compute the model parameters. This is somewhat alleviated by choosing a fixed number of iterations but that has its own demerits.
If you choose a lower number of iterations, the solution obtained may not be optimal. In this way RANSAC offers a trade-off between compute time versus model detection accuracy.
Since the top of the table in the scene is the single most prominent plane, after ground removal, you can effectively use RANSAC to identify points that belong to the table and discard/filter out those points using a relatively low number of iterations.
Another popular use case of such plane segmentation appears in mobile robot autonomous navigation.
For collision avoidance with objects and to determine traversable terrain, ground plane segmentation is an important part of a mobile robot’s perception toolkit.